home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / PartMaker 4.4 / PartMaker Documents / SamplePart (C)• / SamplePart (C)•.rsrc / dFRK_5020 < prev    next >
Encoding:
Text File  |  1995-12-14  |  1.8 KB  |  73 lines

  1. /*
  2.     File:        SamplePartInit.cpp
  3.  
  4.     Contains:    Init routines for SamplePart object
  5.  
  6.     Written by:    Steve Smith
  7.  
  8.     Copyright:    © 1994,95 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. // -- Compiler/Preprocessor Switches --
  13.  
  14. #ifndef _COMPILERDEFS_
  15. #include "CompDefs.h"
  16. #endif
  17.  
  18. // -- OpenDoc Utilities --
  19.  
  20. #ifndef _EXCEPT_
  21. // Exceptions define several important macros (ie. CHECKENV)
  22. // which are used in the SOM method dispatch glue. If Except.h
  23. // is not included early enough, exceptions may not be thrown
  24. // correctly when returning from a SOM method with the "ev" parameter set.
  25. #include <Except.h>
  26. #endif
  27.  
  28. // -- OpenDoc Utilities --
  29.  
  30. #ifndef _USERSRCM_
  31. #include <UseRsrcM.h>
  32. #endif
  33.  
  34. #ifndef _ODMEMORY_
  35. #include <ODMemory.h>
  36. #endif
  37.  
  38. // -- MacToolbox Includes --
  39.  
  40. #ifndef __CODEFRAGMENTS__
  41. #include <CodeFragments.h>
  42. #endif
  43.  
  44. #pragma segment SamplePartInit
  45.  
  46. //------------------------------------------------------------------------------
  47. // Prototypes
  48. //------------------------------------------------------------------------------
  49.  
  50. extern pascal OSErr SamplePartCFMInit(CFragInitBlockPtr initBlkPtr);
  51.  
  52.  
  53. //------------------------------------------------------------------------------
  54. // Functions
  55. //------------------------------------------------------------------------------
  56.  
  57. extern pascal OSErr SamplePartCFMInit(CFragInitBlockPtr initBlkPtr)
  58. {
  59.     // We are using OpenDoc's memory mgmt calls, so we must
  60.     // initialize the interface to the memory manager.
  61.     OSErr err1 = InitODMemory();
  62.     // We must also capture the relevant information about
  63.     // our library file so that we may access our resources.
  64.     OSErr err2 = InitLibraryResources(initBlkPtr);
  65.  
  66. #if ODDebug
  67.     // DEBUG - drop into debugger if button down when lib loaded.
  68.     if ( Button() ) DebugStr("\p");
  69. #endif
  70.  
  71.     return (OSErr) (err1 != noErr) ? err1 : err2;
  72. }
  73.